from Crypto.PublicKey import RSA

key = RSA.generate(2023)
# 公钥 私钥
pri_key_text = key.export_key('PEM')
pub_key_text = key.public_key().export_key('PEM')

with open("encrypt/pub_key.pem", 'wb') as file:
  file.write(pub_key_text)
with open("decrypt/pri_key.pem", 'wb') as file:
  file.write(pri_key_text)
